This invention relates to digital Finite Impulse Response filters, where it is required to change the filter transfer function without interrupting the passage of a desired signal through the filter.
Finite Impulse Response Filters (referred to herein as FIR filters) are very well known and commonly comprise a tapped delay line, or its digital equivalent, with the signal from each tapping being scaled or multiplied by a respective coefficient, and the tapped signals being combined to produce an output signal. Digital FIR filters can be implemented on programmable hardware (e.g. Digital Signal Processor (DSP) chips), or on dedicated hardware.
There is a common requirement for example in the audio industry for signals to run continuously through a circuit while characteristics or transfer functions of FIR filters therein are changed; audio signals must not be interrupted as this would cause clicks or other artefacts for a listener.
For the purposes of the present specification, it is to be understood that the changing of at least one coefficient in a first FIR and the consequent changing of the filter transfer function effectively produces a second FIR with a different transfer function, and reference herein to first and second FIR filters is to be construed, where appropriate, accordingly.
Where an FIR filter function is to be changed without interruption to the signals flowing through the system, known/obvious methods for doing this are as follows:
1) Suddenly update all the filter coefficients within one clock cycle of the system. PA1 2) Crossfade each filter coefficient to its new value over several system clock cycles, doing this simultaneously for all filter coefficients PA1 3) Implement a second physically separate FIR filter in parallel with the first, then crossfade between the outputs of the two filters, taking several system clock cycles to do so PA1 4) Update the filter coefficients at a slower rate, one by one PA1 a) dividing a first filter into a plurality of sections, PA1 b) rendering all but the fist section of the first filter inoperative by fading out their output, PA1 c) changing the coefficients of an inoperative section of the first filter to the coefficients of a first section of a second filter, which is similarly divided into a like plurality of sections, and PA1 d) conducting the desired signal through the first section of the second filter while rendering the first section of the first filter inoperative by fading out its output signal. PA1 1) The first filter A is initially being computed. The half-length filter consisting of the first half of filter A (referred to as A1) is computed in parallel. This requires no additional processing power as A1 is computed as part of filter A in any case. A crossfade between the outputs of filters A and A1 is performed over a number of system clock cycles. Filter A1 is now running, using only half the available processing power. PA1 2) A half-length version of the second filter (B1) is computed in parallel with A1, using up the remaining processing power. A crossfade between the outputs Of filters A1 and B1 is performed over a number of system clock cycles, resulting in only filter B1 running, taking half the available processing power. This step can be repeated as many times as desired to switch through a number of filters C, D, etc. PA1 3) The full-length filter B is now computed in parallel with B1. A crossfade from the output of B1 to the output of B is performed over a number of clock cycles. Filter B is now running.
An example of one such method in which successive interpolated co-efficients are switched in to change the so-efficients of a filter from an initial set of co-efficients to a final set of co-efficients is described in European Patent 0135 066. However such a method does not bring about a smooth switching between filter functions.
Each of these methods has disadvantages. (1) causes a sudden change in the filter output which is generally undesirable. In the case of audio, this is usually heard as a click. (2) is the equivalent of (1), except that the transition to the new filter is performed more gradually to avoid the sudden transition in filter output. The disadvantage of this method is that a new set of filter coefficients has to be calculated (or stored in a look-up table) for each of the intermediate steps. This requires additional processing power or storage. Processing power is a valuable resource and additional processing power is often not available. (3) is functionally equivalent to (2) but still requires additional processing power to implement the second physically separate filter in parallel with the first. (4) is undesirable as the impulse response and hence frequency response of the filter is altered in a somewhat unpredictable way as each filter coefficient is updated.
It is an object of the present invention to provide a method of switching between first and second digital FIR filters without creating significant disturbance in a signal passing through the filters, and wherein the requirements of processing power to effect the change are reduced.
The invention relies on the fact that, in most real applications, most of the energy of a FIR filter is concentrated towards the front of the filter (or it can be designed to achieve this). A half-length filter, with only half of the number of coefficients, is therefore a good approximation to the full-length filter and a crossfade from the full-length filter to the half-length filter is quite easy to disguise. Although the half-length filter may not be accurate enough for continuous use, it is usually accurate enough to be used for the short tune it takes to crossfade to a second half-length filter with a different transfer function. Thus the filter switching is broken down into a number of steps, each step requiring a smaller amount of processing power than heretofore required.
According to one aspect of the present invention there is provided a method of switching between first and second digital FIR filters while permitting uninterrupted passage of a desired signal therethrough, the method including:
Preferably the method of the present invention includes the following steps.
The rates at which the crossfades are performed depends on the application. In some applications, a very fast crossfade, or even a sudden switch, may be satisfactory. In other applications, a slower crossfade may give better results. Also, the shape of the crossfade (linear or otherwise) can be varied to optimise results.
In subsequent steps, the changing of the second, and any further, filter sections will take place in a corresponding manner.
According to a further aspect of the there is provided a filter apparatus having an input terminal, an output terminal, a digital FIR filter comprising two or more sections each or which has a control means for setting the filter function of the respective section, an input switch means and an output fader means, said input switch means and said output fader means being constructed and arranged relative to the input terminal, the output terminal and each of the sections so as to be operable either to connect two or more sections in series between the input terminal and output terminal and thereby effectively form a fist FIR filter with a first filter function, or alternatively, to render inoperable one or more. Sections by fading out its output signal whilst leaving one or more sections connected in series between the input terminal and output terminal and thereby effectively form a second FIR filter with a second filter function without disrupting the passage of a signal through the filter apparatus from the input terminal to the output terminal, said control means being operable to change the filter function of the inoperable section or sections.
According to a further aspect of the present invention there is provided a digital FIR filter apparatus which is selectively changeable from a first digital FIR filter to a second digital FIR filter with a different filter function, while permitting uninterrupted passage of a signal there through to be filtered, the filter apparatus comprising at least first and second filter sections, each section comprising a series chain of delay elements with intermediate tapping points, and scaler elements with adjustable scaling coefficients being connected to respective tapping points, the outputs of the scalers being connected to a summing means, wherein the output of the first and second section summing means are coupled to respective first and second inputs of an output fader means for providing a filter output, and wherein an input terminal of the digital filter apparatus together with both ends of the series chains of both filter sections are selectively coupled together via an input switch means, whereby to permit the output of one filter section to be faded out white its scaling coefficients are changed, and for the series chains of the filter sections to be selectively connected in series, either chain being upstream of the other.
Preferably the output fader means comprises fader means, wherein the first and second inputs thereof are coupled to respective scalers having adjustable scaling coefficients, the outputs of the scaling means being coupled to a summing means to provide the filter output signal.
Whilst the filters of the present invention may be divided into any number of sections, the more sections that are provided, the longer is the overall switching time. It is therefore preferred to divide the filters into just two sections, preferably of equal length, or at least generally equal length, so that the processing power requirements are reduced by half, which is sufficient for most applications envisaged.
Whilst a simple switching in a single clock cycle is possible between the various filter sections, it is preferred to employ fading (crossfading) between the filter sections over a plurality of clock cycles in order to reduce the risk of disturbance to the signal being fed across the filters.
In this respect it is preferable that the input switch means comprises first and second two way switches each connected between the input terminal and selected ends of the series chains of the filter sections.
In a further aspect of the invention where there are two sections, the input terminal of the filter apparatus together with both ends of the series chains of delay elements of both sections are selectively coupled together via the input switch means whereby to permit one filter section either to be switched out of circuit while its scaling co-efficients are changed, the series chain of delay elements of the other filter section to be connected in series, between the input switch means and the output switch means or for the series chain of delay elements of either section to be connected in series upstream of the series chain of delay elements of the other chain.
One particular application envisaged for the present invention is that of audio sound reproduction with accurate location of the reproduced sound in three dimensions. This is commonly known as binaural reproduction. For "lo-fi" applications such as Arcade games, movement of a manually operable joystick may cause a change in the apparent position of a reproduced sound, e.g. an engine sound. In order to achieve this, a sound source may be recorded monophonically through a single microphone, and the recorder signal may be subjected to a pair of filters with known transfer functions in order to produce a binaural signal with the sound reproduced at a particular location. If the location is to be changed, then the filter transfer function is changed, in real time and in accordance with the present invention, to produce a second filter representing the sound at a further location. In such application, the filter may require significant processing power, and so the present invention avoids any additional processing power to effect the filter change.